﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Pages/Site.Master"
    CodeBehind="Apostas.aspx.vb" Inherits="SiteApostas.Apostas" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%">
        <tr align="center">
            <td>
                <asp:RadioButtonList ID="rblVerApostar" runat="server" AutoPostBack="True" RepeatDirection="Horizontal"
                    Font-Bold="true">
                    <asp:ListItem Value="VER">Ver Apostas</asp:ListItem>
                    <asp:ListItem Selected="True" Value="APOSTAR">Fazer Apostas</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr align="center">
            <td>
                <asp:DropDownList ID="ddlApostas" runat="server" AutoPostBack="True">
                </asp:DropDownList>
            </td>
        </tr>
        <tr align="center">
            <td>
                <asp:Label ID="lblErro" runat="server" Visible="false"></asp:Label>
                <asp:Literal ID="litErro" runat="server" Mode="Encode" Visible="false"></asp:Literal>
            </td>
        </tr>
    </table>
    <div>
        <asp:GridView ID="grdJogos" runat="server" AutoGenerateColumns="False" Width="100%"
            GridLines="None" ShowFooter="True" HorizontalAlign="Left">
            <HeaderStyle Height="40px" />
            <Columns>
                <asp:TemplateField Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblID" runat="server" Text='<%#Eval("IDJornadaDescricao")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblIDCampeonato" runat="server" Text='<%#Eval("IDCampeonato")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblIDAposta" runat="server" Text='<%#Eval("IDAposta")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblNumJogo" runat="server" Text='<%#Eval("NumJogo")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Jogos">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtEquipa1" runat="server" Text='<%#Eval("Equipa1")%>' ReadOnly="true"
                                        Enabled="false"></asp:TextBox>
                                </td>
                                <td>
                                    -
                                </td>
                                <td>
                                    <asp:TextBox ID="txtEquipa2" runat="server" Text='<%#Eval("Equipa2")%>' ReadOnly="true"
                                        Enabled="false"></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Apostas">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemTemplate>
                        <table>
                            <tr>
                                <td>
                                    <asp:TextBox ID="txtAposta1" runat="server" Width="30px" Text='<%#Eval("Aposta1")%>'
                                        Enabled='<% #Eval("ApostaValida") %>'></asp:TextBox>
                                </td>
                                <td>
                                    -
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAposta2" runat="server" Width="30px" Text='<%#Eval("Aposta2")%>'
                                        Enabled='<% #Eval("ApostaValida") %>'></asp:TextBox>
                                </td>
                            </tr>
                        </table>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:LinkButton ID="lnkBtnApostar" runat="server" Font-Underline="false" CommandName="APOSTAR">
                                        <img alt="" src="../Styles/Images/accept.png" style='border-width:0px;' />
                                        Apostar</asp:LinkButton>
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Data/Hora">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemTemplate>
                        <asp:Label ID="lblData" runat="server" Text='<%#Eval("Horario")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemTemplate>
                        <asp:Label ID="lblRealizado" runat="server" Text='<%#Eval("EstadoJogo")%>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Resultado">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemTemplate>
                        <asp:TextBox ID="txtResultadoEquipa1" runat="server" Width="30px" Text='<%#Eval("ResultadoEquipa1")%>'
                            ReadOnly="true" Enabled="false"></asp:TextBox>
                        &nbsp;<asp:TextBox ID="txtResultadoEquipa2" runat="server" Width="30px" Text='<%#Eval("ResultadoEquipa2")%>'
                            ReadOnly="true" Enabled="false"></asp:TextBox>
                    </ItemTemplate>
                    <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                    <FooterTemplate>
                        Total:
                    </FooterTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Pontos">
                    <HeaderStyle HorizontalAlign="Left" />
                    <ItemTemplate>
                        <asp:TextBox ID="txtPontos" runat="server" Width="30px" ReadOnly="true" Enabled="false"
                            Text='<% #Eval("Pontos") %>'></asp:TextBox>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:TextBox ID="txtTotalPontos" runat="server" Width="30px" ReadOnly="true" Enabled="false"></asp:TextBox>
                    </FooterTemplate>
                </asp:TemplateField>
            </Columns>
            <EmptyDataRowStyle HorizontalAlign="Center" Font-Bold="true" />
            <EmptyDataTemplate>
                Jornada ainda não criada...
            </EmptyDataTemplate>
        </asp:GridView>
    </div>
</asp:Content>
